<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;


class GiftBag extends Base
{
    protected $table = 'gift_bag';

    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
    }

    public function getGiftBag($user_id, $gift_id)
    {
        $where['gift_id'] = $gift_id;
        $where['user_id'] = $user_id;
        $data = DB::connection("mysql_kkaudio")
            ->table($this->table)
            ->where($where)
            ->first();
        $data = self::objToArray($data);
        return $data;
    }
}